﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Cspl.AnimalFight.Lib.Data
{
    public abstract class AnimalBase
    {
        #region Protected Fields

        protected string _animalName;
        protected int _healtPower;
        protected int _defensePower;
        protected int _attactPower;
        protected bool _hasEscaped;
        protected bool _isDead;

        #endregion

        #region Propeties

        public bool HasEscaped
        {
            get { return _hasEscaped; }
            set { _hasEscaped = value; }
        }


        public bool IsDead
        {
            get { return _isDead; }
            set { _isDead = value; }
        }
        
        

        public string AnimalName
        {
            get { return _animalName; }
            set { _animalName = value; }
        }
        

        public int HP
        {
            get { return _healtPower; }
            set { _healtPower = value; }
        }
        
        public int DP
        {
            get { return _defensePower; }
            set { _defensePower = value; }
        }
               
        public int AP
        {
            get { return _attactPower; }
            set { _attactPower = value; }
        }

        #endregion

        public virtual void Escape()
        {
            // bug fixed by Agni, animal can run away even its already dead.
            if (this._isDead)
            {
                Console.WriteLine("The Animal is already dead, cannot escape.");
            }
            else
            {
                this.HasEscaped = true;
                Console.WriteLine("The Animal escaped.");
            }
        }
        
        
    }
}
